﻿using OpenHardwareMonitor.Hardware;
using Prism.Mvvm;
using Prism.Regions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tools.Modules.Navigations.ViewModels
{
    public class HardwareInfoViewModel : BindableBase, INavigationAware
    {
        public Computer Computer { get; set; }
        public HardwareInfoViewModel()
        {
            Computer = new Computer
            {
                CPUEnabled = true,
                RAMEnabled = true,
                MainboardEnabled = true,
                GPUEnabled = true,
                HDDEnabled = true,
                FanControllerEnabled = true,
            };
            Computer.Open();
            foreach(var h in Computer.Hardware)
            {
                h.Update();
            }
        }

        public bool IsNavigationTarget(NavigationContext navigationContext)
        {
            return true;
        }

        public void OnNavigatedFrom(NavigationContext navigationContext)
        {
        }

        public void OnNavigatedTo(NavigationContext navigationContext)
        {
        }
    }
}
